﻿#ifndef XMLCONFIG_H
#define XMLCONFIG_H

#include <QObject>
#include <QMap>

#include "datastruct.h"

class XmlConfig
{
public:
    XmlConfig();

    bool containFlow(const int& level) const;
    Flow flow(const int& level) const;

    QList<Subflow> subflow0List(const int& level) const;
    QList<Subflow> subflow1List(const int& subflow0) const;
    QList<Subflow> subflow2List(const int& subflow1) const;
    QList<Subflow> subflow3List(const int& subflow2) const;

    bool containOperation(const int& operationId) const;
    QList<Step> stepList(const int& operationId) const;


private:
    void readConfig(const QString& filename);

private:
    // flow
    QMap<int, Flow> m_flowMap;
    // subflow0, 1, 2, 3
    QMap<int, Subflow> m_subflow0Map;
    QMap<int, Subflow> m_subflow1Map;
    QMap<int, Subflow> m_subflow2Map;
    QMap<int, Subflow> m_subflow3Map;

    // operation
    QMap<int, QList<Step>> m_operationMap;


};

#endif // XMLCONFIG_H
